<template>
	<view class="weather"
		style="height: 100rpx;border: 1px solid #ccc;margin: 5px; border-radius: 5px;display: flex;justify-content: space-between; padding: 10rpx;align-items: center; "
		v-for="(item,index) in weather">
		<!-- <view class="icon" style="width: 100rpx;height: 100rpx; ">
					<image style="width: 100%;height: 100%;" :src="'/static/weather/icons/'+ weather.icon +'.svg'"
						mode=""></image>
				</view> -->
		<view class="text" style="font-size: 40rpx;margin-left: 7px;">
			温度: {{item.windScaleNight}}°C
		</view>
		<view class="text" style="font-size: 34rpx;margin-left: 10rpx;">
			天气: {{item.textDay}}
		</view>
		<view class="text" style=" margin-left: 10rpx;">
			风向: {{item.windDirNight}}
		</view>
		<view>
			<view class="text" style="margin-left: 10rpx;">
				日期： {{item.fxDate}}
			</view>
		</view>
	</view>
</template>
<script setup>
	import {
		ref
	} from 'vue'
	import {
		onLoad
	} from '@dcloudio/uni-app'
	import {
		CONFIG
	} from '../../utils/config';
	onLoad(() => {
		getWeather()
	})
	let weather = ref([])
	async function getWeather() {
		let res = await uni.$get(CONFIG.hefeng_7d, {
			key: CONFIG.hefeng_key,
			location: CONFIG.hefeng_locition
		})
		if (res.code == 200) {
			weather.value = res.daily
			console.log(res.daily)
		}
	}
</script>

<style>

</style>